package com.rajaev.dtu.tractor.domain.repository.mysql;

import com.rajaev.dtu.tractor.domain.entity.BatteryOnlineLogPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Repository
@Mapper
public interface BatteryOnlineLogDao {

    void insertLog(BatteryOnlineLogPo batteryOnlineLogPo);

    BatteryOnlineLogPo queryBatteryOnlineRecord(Integer batteryId);

    void setBatteryLogOut(@Param("logId") Integer logId,@Param("logoutTime") LocalDateTime logoutTime);

    List<BatteryOnlineLogPo> queryByVinAndDate(@Param("vin") String vin,
                                               @Param("startTime") Date startTime,
                                               @Param("endTime") Date endTime);

}
